package com.zrrd.yunchmall.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.zrrd.yunchmall.dubbo.IProductService;
import com.zrrd.yunchmall.product.entity.Product;
//import org.springframework.data.annotation.Reference;
//import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Reference
    private IProductService productService;

    @GetMapping("/hello")
    public String hello() {
        return "hello dubbo.";
    }

    @GetMapping("/product/{pid}")
    public Product product(@PathVariable int pid) {
        return productService.getById(pid);
    }
}
